package org.vectrics.recruiter.web.tags;

/**
 * Title:        vectrics Server for Logging
 * Description:
 * Copyright:    Copyright (c) 2001
 * Company:      vectrics Software Inc.  Service is Built In
 * @author Mike Moore
 * @version 1.0
 */



import javax.servlet.jsp.tagext.TagSupport;



public class UserEmploymentEditTag extends TagSupport {

	private static final long serialVersionUID = -344787180027069949L;

	public UserEmploymentEditTag() {
    }

    /*
    protected String doRender(Request request, Properties attributes) {
        log.debug("doRender() called");
        String empId = request.getParameter(SaveUserEmploymentAction.EMP_ID_PARAM);
        UserEmployment emp = null;
        
        Table mainTable = new Table();
        Row mainRow = mainTable.addRow();
        Cell mainCell = mainRow.addCell();
        
        userProfile = userManager.getUser(request.getHttpRequest());

        if (empId != null) {
            log.debug("doRender() - id param passed - looking for employment entry.");
            try {
            	emp = RecruitUserManager.findEmployment(userProfile, empId);
            }
            catch (DataException de) {
            	log.error("DataException finding employment", de);
            }
        }
        
        log.debug("doRender() - getting http params");
        
        if (request.hasInvalidParams() == false) {
            log.debug("doRender() - creating temporary params for user information.");
            
            if (emp != null) {
                request.addParam(SaveUserEmploymentAction.DESCRIPTION_PARAM, emp.getDescription());
                request.addParam(SaveUserEmploymentAction.TITLE_PARAM, emp.getTitle());
                request.addParam(SaveUserEmploymentAction.COMPANY_PARAM, emp.getCompanyName());
            }
        }
        else {
           log.debug("doRender() - request has invalid params, assuming that this form is being shown to fix bad submission.");
        }
        
        
        log.debug("doRender() - creating job edit entry form.");
        SimpleForm form = new SimpleForm(request);
        form.setMethod("POST");
        mainCell.addElement(form);
        form.setAction(request.getHttpRequest().getContextPath() + "/main/user/resume");
        form.addHidden("action", SaveUserEmploymentAction.ACTION_NAME);
        UserEmployment employment = null;
        if (empId != null) {
            form.addHidden(SaveUserEmploymentAction.EMP_ID_PARAM, empId);
        }
        
        form.showInvalidParams();
        
        Table bigTable = new Table();
        form.addElement(bigTable);
        Row row = bigTable.addRow();
        Cell formLeftCell = row.addCell();
        
        Table leftTable = new Table();
        leftTable.setWidth(500);
        formLeftCell.addElement(leftTable);
        
        IMG clearImage = new IMG();
        clearImage.setSrc(request.getHttpRequest().getContextPath() + "/graphics/cleardot.gif");
        clearImage.setWidth(130);
        clearImage.setHeight(1);
        clearImage.setAlt("");
        Row hdrRow = leftTable.addRow();
        Cell labelHdrCell = hdrRow.addCell();
        Cell valueHdrCell = hdrRow.addCell();
        labelHdrCell.addElement(clearImage);
        
        form.setTable(leftTable);

        form.addBlankRow();
        log.debug("doRender() - adding title to form.");
        Input edit = form.makeEditRow(SaveUserEmploymentAction.TITLE_PARAM, "Title", true);
        edit.setStyle("width:300px");

        form.addBlankRow();
        form.addMonthYearEdit("Start Date", SaveUserEmploymentAction.START_DATE_PARAM, true);
        form.addBlankRow();
        form.addMonthYearEdit("End Date <br>(blank for present)", SaveUserEmploymentAction.END_DATE_PARAM, false);
        form.addBlankRow();
        log.debug("doRender() - adding description text area to form.");
        TextArea descEntry = new TextArea();
        descEntry.setRows(12);
        descEntry.setCols(80);
        descEntry.setStyle("font-family:verdana,arial,sans serif;font-size=
        	10px");
        if ((emp != null) && (emp.getDescription() != null))
            descEntry.addElement(emp.getDescription());
        form.addTextAreaRow("Description", SaveUserEmploymentAction.DESCRIPTION_PARAM, descEntry, true);


        form.addBlankRow();
        log.debug("doRender() - adding title to form.");
        edit = form.makeEditRow(SaveUserEmploymentAction.COMPANY_PARAM, "Company", true);
        edit.setStyle("width:300px");
        
        log.debug("doRender() - adding buttons to form.");
        form.addSubmitButton("Submit", "Cancel");
            
        log.debug("doRender() - done.");

        return(mainTable.toString());
    }
*/
}
